package com.int_tech.MessageCodeAll.dao;

import com.int_tech.MessageCodeAll.entity.CodeA0;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

/**
 * Created by liubochao on 2018/6/22.
 */
public interface CodeA0Dao extends JpaRepository<CodeA0,Integer> {
    List<CodeA0> findByLatLikeAndStatus(String lat, int i);

    List<CodeA0> findByLatAndStatus(String lat, int i);

    List<CodeA0> findByStatus(int i);

    List<CodeA0> findByStatusOrderByCreatedTimeDesc(int i);

    @Query("select c from CodeA0 c where c.carNumber=?1 and c.createdTime<?2 order by c.createdTime desc ")
    List<CodeA0> findByCarNumberAndCreatedTimeBefore(String carNumber, Date createdTime);

    List<CodeA0> findByStatusOrderByCreatedTimeAsc(int i);
}
